package edu.cmu.vlis.wassup.sender;


import java.util.List;

import javax.jms.JMSException;
import javax.jms.TopicConnection;

public class ShutdownMessageProcessor extends Thread {
	private List<TopicConnection> topicConnList;
	
	ShutdownMessageProcessor(List <TopicConnection> topicConnList) {
		this.topicConnList = topicConnList;
	}
	public void run() {
		System.out.println("Shutting down all the Connections for listeners");
		for(TopicConnection topicConn : topicConnList) {
			try {
				if(topicConn!=null)
				 topicConn.close();
			} catch (JMSException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}